<template>
  <div>
    <mt-swipe :auto="4000" style="height:200px">
      <mt-swipe-item v-for="item in swipes" :key="item.id">
        <img :src="item.img" alt="" srcset="">
      </mt-swipe-item>
    </mt-swipe>
  </div>
</template>

<script>
export default {
  name: 'Home',
  data () {
    return {
      swipes: 	[
        {
          "id": 1,
          "url": "",
          "img": "http://g.hiphotos.baidu.com/image/pic/item/203fb80e7bec54e7f0e0839fb7389b504fc26a27.jpg"
        },
        {
          "id": 2,
          "url": "",
          "img": "http://g.hiphotos.baidu.com/image/h%3D300/sign=b5e4c905865494ee982209191df4e0e1/c2cec3fdfc03924590b2a9b58d94a4c27d1e2500.jpg"
        }
      ]
    }
  },
  created(){
    this.$axios.get("yg1ar")
    .then(data =>{
      console.log(data);
      this.swipes = data.data.message
    })
    .catch(err =>{
      console.error(err);
    })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
